#ifndef TEXTUREMGR_H_
#define TEXTUREMGR_H_

#include <GL/glew.h>
#include <string>
#include <map>

typedef struct textureInfo {
	std::string filename;
	GLuint textureId;
	GLenum textureUnit;
	std::string samplerName;
	GLuint samplerId;
	GLenum format;
	bool loaded;
} TextureInfo;

class TextureMgr {
	int loadedTexture;
	std::map<std::string, TextureInfo*> texturesInfo;

	static TextureMgr* instance;
	TextureMgr();

	void initTexture(TextureInfo* info);

public:
	// /* **
	static float cabinDiffuseTexture[48];
	static float cabinDirtTexture[48];
	// /* **
	static float towerColumnDiffuseTexture[48];
	static float towerColumnDirtTexture[48];
	// /* **
	static float towerTopDiffuseTexture[48];
	static float towerTopDirtTexture[48];
	// /* **
	static float towerLatticeDiffuseTexture[48];
	static float towerLatticeDirtTexture[48];
	// /* **
	static float boomColumnDiffuseTexture[48];
	static float boomColumnDirtTexture[48];
	// /* **
	static float boomFrameDiffuseTexture[48];
	static float boomFrameDirtTexture[48];
	// /* **
	static float cableDiffuseTexture[12];
	static float cableDirtTexture[12];

	static std::string diffuseTexture;
	static std::string dirtTexture;

	static TextureMgr* getInstance();

	void loadTextures(GLuint programHandler);

	float* getCabinDiffuseTextureData() { return cabinDiffuseTexture; };
	float* getCabinDirtTextureData() { return cabinDirtTexture; };

	float* getTowerColumnDiffuseTextureData() { return towerColumnDiffuseTexture; };
	float* getTowerColumnDirtTextureData() { return towerColumnDirtTexture; };

	float* getTowerTopDiffuseTextureData() { return towerTopDiffuseTexture; };
	float* getTowerTopDirtTextureData() { return towerTopDirtTexture; };

	float* getTowerLatticeDiffuseTextureData() { return towerLatticeDiffuseTexture; };
	float* getTowerLatticeDirtTextureData() { return towerLatticeDirtTexture; };

	float* getBoomColumnDiffuseTextureData() { return boomColumnDiffuseTexture; };
	float* getBoomColumnDirtTextureData() { return boomColumnDirtTexture; };

	float* getBoomFrameDiffuseTextureData() { return towerLatticeDiffuseTexture; };
	float* getBoomFrameDirtTextureData() { return towerLatticeDirtTexture; };

	float* getCableDiffuseTextureData() { return cableDiffuseTexture; };
	float* getCableDirtTextureData() { return cableDirtTexture; };
};


#endif /* TEXTUREMGR_H_ */
